According to a motion picture coding standard system such as ITU-T H.261, H.263, H.264, ISO/IEC MPEG-2, MPEG-4 part 2 or the like, coding is carried out every coding unit called as a macroblock while switching a prediction mode. It is said that it greatly affects the coding performance how the switching operation is carried out.
One of the methods of switching the prediction mode is disclosed in TMN9 which is a test model of ITU-T H.263 (see Non-patent Document 1, ITU-T, Study Group 16: “Video Codec Test Model, Near-term, Version 9 (TMN9)”, Document: Q15-C-15, 1997) In the Non-patent Document 1, threshold value processing is carried out by using the absolute value difference sum between an input picture and a predictive picture achieved by motion compensation, and the absolute value difference sum between the input picture and the macroblock of the input picture, whereby three prediction modes of an inter-frame prediction mode of 8×8 blocks, an inter-frame prediction mode of 16×16 blocks and an intra-frame prediction mode are switched to one another.
Furthermore, a method of selecting the prediction mode of each macroblock on the basis of Lagrange's undetermined multiplier method is introduced in a non-patent document 2 (Gary J. Sullivan and Thomas Wiegand, “Rate-Distortion Optimization for Video Compression”, IEEE Signal Processing Magazine, Vol. 15, No. 6, pp 74-90, November 1998). More specifically, coding is actually carried out in each prediction mode to determine a number of coded bits (rate) and a coding distortion. Thereafter, the cost of each prediction mode to the same quantization parameter is calculated under the condition that the Lagrange's undetermined multiplier is assumed as the function of the quantization parameter, and the prediction mode in which the cost is minimum is selected. This publication reports that the coding efficiency is more greatly enhanced as compared with TMN9 by this method.
The switching method of the prediction mode disclosed in the non-patent document 1 is an easy method, and the switching operation of the prediction mode can be performed with small computational complexity. However, this method pays no attention to the actual number of coded bits (rate) and the distortion, and thus it can be hardly said that the switching operation of the prediction mode which is optimal in the relationship between the number of coded bits and the distortion is carried out. Accordingly, this method does not greatly enhance the coding efficiency.
According to the method disclosed in the non-patent document 2, a number of coded bits-a coding distortion function having the same gradient with respect to the same quantization parameter is assumed. Therefore, when the quantization parameter is varied or when the shape of the number of coded bits-coding distortion function is different from the assumed shape, it is impossible to carry out accurate comparison estimation on the coding cost, and thus a proper prediction mode cannot be selected. Furthermore, it is also impossible to compare the coding cost when the quantization parameter is varied under the combination with the number of coded bits control. Accordingly, it cannot be expected that the coding efficient is greatly enhanced by this method.
Therefore, Japanese Patent Application No. 2004-177190 discloses a method of selecting not only an optimal prediction mode, but also an optimal quantization parameter. According to this method, not only the prediction mode of each macroblock, but also the value of the quantization parameter is varied to calculate the cost, and the prediction mode and the quantization parameter that provides the minimum cost are selected. This method more greatly enhances the coding efficiency as compared with the non-patent document 2. However, the frequency at which the coding is actually carried out by using each prediction mode and each quantization parameter is large, and thus the computational complexity may be increased.
Therefore, an object of the invention is to provide image coding control method and device in which image coding having high coding efficiency can be carried out with a small computational complexity by properly determining a prediction mode and a quantization parameter.